import Foundation

enum AIProvider: String, CaseIterable, Identifiable, Codable {
    case openAI = "OpenAI"
    case anthropic = "Anthropic"
    
    var id: String { self.rawValue }
}

enum AIModelType: String, CaseIterable, Identifiable, Codable {
    // OpenAI 模型
    case gpt4 = "gpt-4"
    case gpt4Turbo = "gpt-4-turbo"
    case gpt4o = "gpt-4o"
    case gpt35Turbo = "gpt-3.5-turbo"
    
    // Anthropic 模型
    case claude3Opus = "claude-3-opus"
    case claude3Sonnet = "claude-3-sonnet"
    case claude3Haiku = "claude-3-haiku"
    
    var id: String { self.rawValue }
    
    
    var provider: AIProvider {
        switch self {
        case .gpt4, .gpt4Turbo, .gpt35Turbo, .gpt4o:
            return .openAI
        case .claude3Opus, .claude3Sonnet, .claude3Haiku:
            return .anthropic
        }
    }
    
    var displayName: String {
        switch self {
        case .gpt4:
            return "GPT-4"
        case .gpt4Turbo:
            return "GPT-4 Turbo"
        case .gpt4o:
            return "GPT-4o"
        case .gpt35Turbo:
            return "GPT-3.5 Turbo"
        case .claude3Opus:
            return "Claude 3 Opus"
        case .claude3Sonnet:
            return "Claude 3 Sonnet"
        case .claude3Haiku:
            return "Claude 3 Haiku"
        }
    }
}

struct AIModelConfig: Codable {
    var provider: AIProvider = .openAI
    var modelType: AIModelType = .gpt4Turbo
    var temperature: Double = 0.7
    var maxTokens: Int = 2000
    var systemPrompt: String = "你是一个有用的AI助手。"
    
    // API 密钥存储在 Keychain 中，不直接存储在这里
} 
